package com.sysh.service.impl;

import com.sysh.entity.Collects;
import com.sysh.entity.Restaurants;
import com.sysh.mapper.CollectsMapper;
import com.sysh.mapper.RestaurantMapper;
import com.sysh.service.CollectsService;
import com.sysh.service.RestaurantService;
import com.sysh.util.dateFormat;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

/**
 * ClassName:  <br/>
 * Function: 功能<br/>
 * date: 2018年01月17日  <br/>
 *
 * @author 苏积钰
 * @since JDK 1.8
 */

@Service
public class CollectsServiceImpl implements CollectsService {

    @Autowired
    private CollectsMapper collectsMapper;
    public List<Collects> findAll() {
        List<Collects> list=collectsMapper.findAll();

        //更改时间格式，
        for (Collects f:list
             ) {
            Date d=f.getCollectTime();
            f.setCollectDate(dateFormat.dataToString(d));
        }
        return list;
    }
}
